//
//  MonActivityViewController.m
//  myDemo2
//
//  Created by wuxueying on 14-5-4.
//
//

#import "MonActivityViewController.h"
#import "MONActivityIndicatorView.h"

@interface MonActivityViewController () <MONActivityIndicatorViewDelegate>
@end
@implementation MonActivityViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    MONActivityIndicatorView *indicatorView = [[MONActivityIndicatorView alloc] init];
    indicatorView.frame = CGRectMake(0, 30, 100, 20);
    indicatorView.delegate = self;
    indicatorView.numberOfCircles = 5;
    indicatorView.radius = 10;
    indicatorView.internalSpacing = 3;
    //  indicatorView.center = self.view.center;
    [indicatorView startAnimating];
    [self.view addSubview:indicatorView];
}

- (UIColor *)activityIndicatorView:(MONActivityIndicatorView *)activityIndicatorView
      circleBackgroundColorAtIndex:(NSUInteger)index {
    CGFloat red   = (arc4random() % 256)/255.0;
    CGFloat green = (arc4random() % 256)/255.0;
    CGFloat blue  = (arc4random() % 256)/255.0;
    CGFloat alpha = 0.5;
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}

@end
